package com.starnet.studentmanagement.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * <p>
 * 
 * </p>
 *
 * @author sangeng
 * @since 2022-03-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class Students  {

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 学号
     */
    @NotNull(message = "学号不能为空")
    private Integer sid;

    /**
     * 姓名
     */
    @NotNull(message = "姓名不能为空")
    private String sname;

    /**
     * 年龄
     */
    @NotNull(message = "年龄不能为空")
    @Max(value = 120,message = "年龄不能超过120岁")
    @Min(value = 0,message = "年龄不能为负数")
    private Integer age;

    /**
     * 性别
     */
    @Size(min = 1,max = 1,message = "输入男或女")
    private String sexual;

    /**
     * 专业
     */
    @NotNull(message = "专业不能为空")
    private String major;

    /**
     * 学院
     */
    @NotNull(message = "学院不能为空")
    private String college;


}
